<div class="books view">
<h2><?php echo __('Book'); ?></h2>

<table width="100%">
  <tr>
    <td width="15%" align="right">Тип издания или монографии</td>
    <td width="2%" align="right"><font color="red">*</font></td>
    <td width="45%"><?php  echo $book['Booktype']['name']; ?>

	</td>
  </tr>
  <tr>
    <td width="15%" align="right">Если изданное</td>
    <td width="2%" align="right">&nbsp;</td>
    <td width="45%"><?php 
	echo h($book['Book']['is_printed']);  ?></td>
  </tr>
  <tr>
    <td width="15%" align="right">Если электронное</td>
    <td width="2%" align="right">&nbsp;</td>
    <td width="45%"><?php echo h($book['Book']['is_electronic']);  ?></td>
  </tr>
  <tr>
    <td width="15%" align="right">Номер регистрации электронного издания</td>
    <td width="2%" align="right">&nbsp;</td>
    <td width="45%"><?php echo h($book['Book']['electronic_reg_number']);  ?></td>
  </tr>
  <tr>
    <td width="15%" align="right">Тип электронного носителя</td>
    <td width="2%" align="right">&nbsp;</td>
    <td width="45%"><?php echo $book['Mediatype']['name']  ?></td>
  </tr>
  <tr>
    <td width="15%" align="right">Если многотомное</td>
    <td width="2%" align="right">&nbsp;</td>
    <td width="45%"><?php echo h($book['Book']['is_many_volumes']); ?></td>
  </tr>
  <tr>
    <td width="15%" align="right">Название</td>
    <td width="2%" align="right"><font color="red">*</font></td>
    <td width="45%"><?php echo h($book['Book']['book_name']);  ?></td>
  </tr>
  <tr>
    <td width="15%" align="right">Редактор</td>
    <td width="2%" align="right">&nbsp;</td>
    <td width="45%"><?php echo h($book['Book']['book_editor']);  ?></td>
  </tr>
  <tr>
    <td width="15%" align="right">Дополнительная информация</td>
    <td width="2%" align="right">&nbsp;</td>
    <td width="45%"><?php echo h($book['Book']['book_info']);  ?></td>
  </tr>
  <tr>
    <td align="right">Место издательства (Город)</td>
    <td align="right"><font color="red">*</font></td>
    <td><?php echo h($book['Book']['publishing_place']);  ?></td>
  </tr>
  <tr>
    <td align="right">Издательство</td>
    <td align="right"><font color="red">*</font></td>
    <td><?php echo h($book['Book']['publishing_house']);   ?></td>
  </tr>
  <tr>
    <td align="right">Год издания</td>
    <td align="right"><font color="red">*</font></td>
    <td><?php echo h($book['Book']['publishing_year']);  ?></td>
  </tr>
  <tr>
    <td align="right">Всего страниц</td>
    <td align="right">&nbsp;</td>
    <td><?php echo h($book['Book']['pages_total']);  ?></td>
  </tr>
  <tr>
    <td align="right">I S B N</td>
    <td align="right">&nbsp;</td>
    <td><?php echo h($book['Book']['ISBN']);  ?></td>
  </tr>
  <tr>
    <td align="right">Состояние</td>
    <td align="right">&nbsp;</td>
    <td><?php echo $book['Recstatus']['name'];  ?></td>
  </tr>
  <tr>
    <td align="right">Авторы</td>
    <td align="right">&nbsp;</td>
    <td>
    	<?php 
    		// debug ($authors);
    		foreach ($authors as $author):
    			echo $author['fio'].' ';
    			if (!empty($author['linkid'])) {
    				echo $this->Form->postLink(__('Delete'), array('controller' => 'authorlinks', 'action' => 'delete', $author['linkid']), array('target' =>'_blank'), __('Are you sure you want to delete # %s?', $author['fio'])); 
    			}
    			echo '<br />';
    		endforeach;
    	
    	?>
    </td>
  </tr>
</table>
</div>
<br />
<div>
<?php echo $this->Form->create('Book', array('action' => 'edit')); ?>
	<fieldset><legend><?php echo __('Изменить запись'); ?></legend>
	<?php 
		echo $this->Form->hidden('id', array('value' => $book['Book']['id']));
		echo $this->Form->hidden('doedit', array('value' => 1));
		echo $this->Form->end(__('Submit')); 
	?>
	</fieldset>
	<br />
	
<?php echo $this->Form->create('Authorlink', array('action' => 'add', 'target' => '_blank')); ?>
	<fieldset>
		<legend><?php echo __('Добавить соавтора'); ?></legend>
	<?php
		$options = array('1' => 'Преподаватель КГМУ', '2' => 'Студент КГМУ', '3' => 'Внешний автор');
		$attributes = array('legend' => false, 'label' => '');
		echo $this->Form->radio('authortype_id', $options, $attributes);
		echo $this->Form->hidden('recordtype_id', array('value' => $recordtype_id));
		echo $this->Form->hidden('recordid', array('value' => $book['Book']['id']));
		echo $this->Form->hidden('doadd', array('value' => '1'));
	?>
	</fieldset>
	<br />
<?php echo $this->Form->end(__('Submit')); ?>
	<br />
<?php echo $this->Form->create('Book', array('action' => 'delete')); ?>
	<fieldset><legend><?php echo __('Удалить запись'); ?></legend>
	<?php 
		echo $this->Form->hidden('id', array('value' => $book['Book']['id']));
		echo $this->Form->end(__('Submit')); 
	?>
	</fieldset>
	<br />

</div>